package com.easyCms.base.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.easyCms.base.dao.BsStaticDataDAO;
import com.easyCms.base.dao.BsStaticTypeDAO;
import com.easyCms.base.entity.BsStaticData;
import com.easyCms.base.entity.BsStaticType;

@Component
public class BsStaticDataSV {

	@Autowired
	private BsStaticDataDAO bsStaticDataDAO;

	@Autowired
	private BsStaticTypeDAO bsStaticTypeDAO;

	public void setSecStaticDataDAO(BsStaticDataDAO secStaticDataDAO) {
		this.bsStaticDataDAO = secStaticDataDAO;
	}

	public List<BsStaticData> getValidStaticDatasByTypeCode(String typeCode) {
		return this.bsStaticDataDAO.getValidStaticDatasByTypeCode(typeCode);
	}

	public BsStaticData getStaticData(String typeCode, String dataCode) {
		return this.bsStaticDataDAO.getStaticData(typeCode, dataCode);
	}

	public List<BsStaticType> getAllType() {
		return this.bsStaticTypeDAO.getAll();
	}

	public List<BsStaticData> getByValue(String value) {
		return this.bsStaticDataDAO.getByValue(value);
	}

	public List<BsStaticData> getByCode(String code) {
		return this.bsStaticDataDAO.getByCode(code);
	}

	public List<BsStaticData> getByValue(Long typeId, String value) {
		return this.bsStaticDataDAO.getByNewValue(typeId, value);
	}

	public List<BsStaticData> getByCode(Long typeId, String code) {
		return this.bsStaticDataDAO.getByNewCode(typeId, code);
	}

	public BsStaticData getStaticDataByTypeCodeAndValue(String typeCode, String value) {
		return this.bsStaticDataDAO.getStaticDataByTypeCodeAndValue(typeCode, value);
	}


	public String getVideoPath(){
		return this.bsStaticDataDAO.getVideoPath();
	}
}